using System;
using System.Collections.Generic;
using System.Text;
using AF_ORM.CORE;
using System.Data;
using System.Configuration;
using Tongiao.Config;     
using Tongiao.Entity;
namespace Tongiao.ManagerBase
{
                

     public abstract class Tg_LoaiDaoManagerBase
    {
        public Tg_LoaiDaoManagerBase()
        {
            Adapter.ConnectionString =  ConnectionConfig.ConnectionString;            
        }
                    
 
        /// <summary>
        /// Them moi du lieu
        /// </summary>
        /// <returns>Tg_LoaiDaoEntity</returns>
        public Tg_LoaiDaoEntity Insert(Tg_LoaiDaoEntity obj)
        { 
            return (Tg_LoaiDaoEntity) Adapter.Insert(obj);             
        }
 
 
        /// <summary>
        /// Update du lieu theo khoa chinh cua object
        /// </summary>
        /// <returns>Tg_LoaiDaoEntity</returns>
        public Tg_LoaiDaoEntity Update(Tg_LoaiDaoEntity obj)
        { 
            return (Tg_LoaiDaoEntity)Adapter.Update(obj);             
        }
 
 
        public Tg_LoaiDaoEntity Delete(Tg_LoaiDaoEntity obj)
        { 
            return (Tg_LoaiDaoEntity)Adapter.Delete(obj);             
        }
 


        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>Tg_LoaiDaoEntity</returns>
        public Tg_LoaiDaoEntity DeleteById (Tg_LoaiDaoEntity obj)
        { 
            return (Tg_LoaiDaoEntity)Adapter.DeleteByField(obj,"Id");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Id 
        /// </summary>
        /// <returns>Tg_LoaiDaoEntity</returns>
        public Tg_LoaiDaoEntity DeleteById (int Id )
        { 
            Tg_LoaiDaoEntity obj = new Tg_LoaiDaoEntity();
            obj.Id = Id;  
            return (Tg_LoaiDaoEntity)Adapter.DeleteByField(obj,"Id");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaLoaiDao duoc set trong object
        /// </summary>
        /// <returns>Tg_LoaiDaoEntity</returns>
        public Tg_LoaiDaoEntity DeleteByMaLoaiDao (Tg_LoaiDaoEntity obj)
        { 
            return (Tg_LoaiDaoEntity)Adapter.DeleteByField(obj,"MaLoaiDao");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaLoaiDao 
        /// </summary>
        /// <returns>Tg_LoaiDaoEntity</returns>
        public Tg_LoaiDaoEntity DeleteByMaLoaiDao (string MaLoaiDao )
        { 
            Tg_LoaiDaoEntity obj = new Tg_LoaiDaoEntity();
            obj.MaLoaiDao = MaLoaiDao;  
            return (Tg_LoaiDaoEntity)Adapter.DeleteByField(obj,"MaLoaiDao");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien TenLoaiDao duoc set trong object
        /// </summary>
        /// <returns>Tg_LoaiDaoEntity</returns>
        public Tg_LoaiDaoEntity DeleteByTenLoaiDao (Tg_LoaiDaoEntity obj)
        { 
            return (Tg_LoaiDaoEntity)Adapter.DeleteByField(obj,"TenLoaiDao");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien TenLoaiDao 
        /// </summary>
        /// <returns>Tg_LoaiDaoEntity</returns>
        public Tg_LoaiDaoEntity DeleteByTenLoaiDao (string TenLoaiDao )
        { 
            Tg_LoaiDaoEntity obj = new Tg_LoaiDaoEntity();
            obj.TenLoaiDao = TenLoaiDao;  
            return (Tg_LoaiDaoEntity)Adapter.DeleteByField(obj,"TenLoaiDao");
        }

 
        /// <summary>
        /// Lay du lieu theo khoa chinh object
        /// </summary>
        /// <returns></returns>
        public Tg_LoaiDaoEntity Select(Tg_LoaiDaoEntity obj)
        { 
            return (Tg_LoaiDaoEntity) Adapter.Select(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(Tg_LoaiDaoEntity obj)
        { 
            return  Adapter.SelectWithCondition(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(Tg_LoaiDaoEntity obj,SelectOptions option)
        {             
            return  Adapter.SelectWithCondition(obj,option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll()
        { 
            return Adapter.SelectAll(new Tg_LoaiDaoEntity());             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll(SelectOptions option)
        { 
            return Adapter.SelectAll(new Tg_LoaiDaoEntity(),option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<Tg_LoaiDaoEntity> SelectAllLST()
        { 
            return  (List<Tg_LoaiDaoEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new Tg_LoaiDaoEntity()),new Tg_LoaiDaoEntity());           
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<Tg_LoaiDaoEntity> SelectAllLST(SelectOptions option)
        { 
            return (List<Tg_LoaiDaoEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new Tg_LoaiDaoEntity(),option),new Tg_LoaiDaoEntity());             
        }
 

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (Tg_LoaiDaoEntity obj)
        { 
            return Adapter.SelectByField(obj,"Id");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (Tg_LoaiDaoEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"Id",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>List<Tg_LoaiDaoEntity></returns>
        public List<Tg_LoaiDaoEntity> SelectByIdLST (Tg_LoaiDaoEntity obj)
        { 
            return  (List<Tg_LoaiDaoEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Id"),new Tg_LoaiDaoEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>List<Tg_LoaiDaoEntity></returns>
        public List<Tg_LoaiDaoEntity> SelectByIdLST (Tg_LoaiDaoEntity obj,SelectOptions option)
        { 
            return  (List<Tg_LoaiDaoEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"Id",option),new Tg_LoaiDaoEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (int Id )
        { 
            Tg_LoaiDaoEntity obj = new Tg_LoaiDaoEntity();
            obj.Id = Id;  
            return Adapter.SelectByField(obj,"Id");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (int Id, SelectOptions option)
        { 
            Tg_LoaiDaoEntity obj = new Tg_LoaiDaoEntity();
            obj.Id = Id;  
            return Adapter.SelectByField(obj,"Id",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_LoaiDaoEntity> SelectByIdLST (int Id )
        { 
            Tg_LoaiDaoEntity obj = new Tg_LoaiDaoEntity();
            obj.Id = Id;  
            return  (List<Tg_LoaiDaoEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Id"),new Tg_LoaiDaoEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_LoaiDaoEntity> SelectByIdLST (int Id, SelectOptions option)
        { 
            Tg_LoaiDaoEntity obj = new Tg_LoaiDaoEntity();
            obj.Id = Id;  
            return  (List<Tg_LoaiDaoEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Id",option),new Tg_LoaiDaoEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaLoaiDao duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaLoaiDao (Tg_LoaiDaoEntity obj)
        { 
            return Adapter.SelectByField(obj,"MaLoaiDao");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaLoaiDao duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaLoaiDao (Tg_LoaiDaoEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"MaLoaiDao",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaLoaiDao duoc set trong object
        /// </summary>
        /// <returns>List<Tg_LoaiDaoEntity></returns>
        public List<Tg_LoaiDaoEntity> SelectByMaLoaiDaoLST (Tg_LoaiDaoEntity obj)
        { 
            return  (List<Tg_LoaiDaoEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaLoaiDao"),new Tg_LoaiDaoEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaLoaiDao duoc set trong object
        /// </summary>
        /// <returns>List<Tg_LoaiDaoEntity></returns>
        public List<Tg_LoaiDaoEntity> SelectByMaLoaiDaoLST (Tg_LoaiDaoEntity obj,SelectOptions option)
        { 
            return  (List<Tg_LoaiDaoEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"MaLoaiDao",option),new Tg_LoaiDaoEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaLoaiDao 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaLoaiDao (string MaLoaiDao )
        { 
            Tg_LoaiDaoEntity obj = new Tg_LoaiDaoEntity();
            obj.MaLoaiDao = MaLoaiDao;  
            return Adapter.SelectByField(obj,"MaLoaiDao");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaLoaiDao duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaLoaiDao (string MaLoaiDao, SelectOptions option)
        { 
            Tg_LoaiDaoEntity obj = new Tg_LoaiDaoEntity();
            obj.MaLoaiDao = MaLoaiDao;  
            return Adapter.SelectByField(obj,"MaLoaiDao",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaLoaiDao 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_LoaiDaoEntity> SelectByMaLoaiDaoLST (string MaLoaiDao )
        { 
            Tg_LoaiDaoEntity obj = new Tg_LoaiDaoEntity();
            obj.MaLoaiDao = MaLoaiDao;  
            return  (List<Tg_LoaiDaoEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaLoaiDao"),new Tg_LoaiDaoEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaLoaiDao duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_LoaiDaoEntity> SelectByMaLoaiDaoLST (string MaLoaiDao, SelectOptions option)
        { 
            Tg_LoaiDaoEntity obj = new Tg_LoaiDaoEntity();
            obj.MaLoaiDao = MaLoaiDao;  
            return  (List<Tg_LoaiDaoEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaLoaiDao",option),new Tg_LoaiDaoEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenLoaiDao duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTenLoaiDao (Tg_LoaiDaoEntity obj)
        { 
            return Adapter.SelectByField(obj,"TenLoaiDao");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenLoaiDao duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTenLoaiDao (Tg_LoaiDaoEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"TenLoaiDao",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenLoaiDao duoc set trong object
        /// </summary>
        /// <returns>List<Tg_LoaiDaoEntity></returns>
        public List<Tg_LoaiDaoEntity> SelectByTenLoaiDaoLST (Tg_LoaiDaoEntity obj)
        { 
            return  (List<Tg_LoaiDaoEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"TenLoaiDao"),new Tg_LoaiDaoEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenLoaiDao duoc set trong object
        /// </summary>
        /// <returns>List<Tg_LoaiDaoEntity></returns>
        public List<Tg_LoaiDaoEntity> SelectByTenLoaiDaoLST (Tg_LoaiDaoEntity obj,SelectOptions option)
        { 
            return  (List<Tg_LoaiDaoEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"TenLoaiDao",option),new Tg_LoaiDaoEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenLoaiDao 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTenLoaiDao (string TenLoaiDao )
        { 
            Tg_LoaiDaoEntity obj = new Tg_LoaiDaoEntity();
            obj.TenLoaiDao = TenLoaiDao;  
            return Adapter.SelectByField(obj,"TenLoaiDao");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenLoaiDao duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTenLoaiDao (string TenLoaiDao, SelectOptions option)
        { 
            Tg_LoaiDaoEntity obj = new Tg_LoaiDaoEntity();
            obj.TenLoaiDao = TenLoaiDao;  
            return Adapter.SelectByField(obj,"TenLoaiDao",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenLoaiDao 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_LoaiDaoEntity> SelectByTenLoaiDaoLST (string TenLoaiDao )
        { 
            Tg_LoaiDaoEntity obj = new Tg_LoaiDaoEntity();
            obj.TenLoaiDao = TenLoaiDao;  
            return  (List<Tg_LoaiDaoEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"TenLoaiDao"),new Tg_LoaiDaoEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenLoaiDao duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_LoaiDaoEntity> SelectByTenLoaiDaoLST (string TenLoaiDao, SelectOptions option)
        { 
            Tg_LoaiDaoEntity obj = new Tg_LoaiDaoEntity();
            obj.TenLoaiDao = TenLoaiDao;  
            return  (List<Tg_LoaiDaoEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"TenLoaiDao",option),new Tg_LoaiDaoEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<Tg_LoaiDaoEntity></returns>
        public List<Tg_LoaiDaoEntity> SelectWithConditionLST (Tg_LoaiDaoEntity obj)
        { 
            return  (List<Tg_LoaiDaoEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj),new Tg_LoaiDaoEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<Tg_LoaiDaoEntity></returns>
        public List<Tg_LoaiDaoEntity> SelectWithConditionLST (Tg_LoaiDaoEntity obj,SelectOptions option)
        { 
            return  (List<Tg_LoaiDaoEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj,option),new Tg_LoaiDaoEntity());
        }

}
}
